import Vue from 'vue';
import VueRouter from 'vue-router';

// 注册vuerouter提供的组件
// <router-view>  <router-link>
Vue.use(VueRouter);

// 路由规则数组(路由表)
const routes = [
  {
    path: '/',
    component: () => import('@/views/index.vue'), // 使用 函数直接导入组件对象
  },
  {
    path: '/form',
    component: () => import('@/views/form.vue'),
  },
  {
    path: '/checkbox',
    component: () => import('@/views/checkbox.vue'),
  },
  {
    path: '/display',
    component: () => import('@/views/display.vue'),
  },
  {
    path: '/alert',
    component: () => import('@/views/alert.vue'),
  },
  {
    path: '/table-render',
    component: () => import('@/views/table-render2.vue'),
  },
  {
    path: '/table-slot',
    component: () => import('@/views/table-slot2.vue')
  }
];

const router = new VueRouter({
  routes,
});

export default router;
